home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / combo-1r / ccredits.cls next >
Text File  |  1999-08-25  |  2KB  |  71 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "cCredits"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Private C(5) As Long
  15. Public PosY As Long
  16.  
  17. Private Sub Class_Initialize()
  18.     For i = 0 To UBound(C)
  19.         C(i) = RGB(i * 51, i * 51, i * 51)
  20.     Next i
  21. End Sub
  22.  
  23. Public Sub Move(Amt As Long)
  24.     PosY = PosY + Amt
  25. End Sub
  26.  
  27. Public Sub Draw(hDC As Long, SWidth As Long, SHeight As Long)
  28.             If PosY = 0 - (14 * (UBound(Strings) + 1)) Then PosY = SHeight
  29.             
  30.             For i = 0 To UBound(Strings)
  31.                 If (i * 14) + PosY < 0 Then
  32.                     n = (i * 14) + PosY
  33.                     n = -Int(n / 2)
  34.                     Select Case n
  35.                         Case 1:
  36.                             SetTextColor hDC, C(5)
  37.                         Case 2:
  38.                             SetTextColor hDC, C(4)
  39.                         Case 3:
  40.                             SetTextColor hDC, C(3)
  41.                         Case 4:
  42.                             SetTextColor hDC, C(2)
  43.                         Case 5:
  44.                             SetTextColor hDC, C(1)
  45.                         Case Else:
  46.                             SetTextColor hDC, C(0)
  47.                     End Select
  48.                 ElseIf ((i + 1) * 14) + PosY > SHeight Then
  49.                     n = ((i + 1) * 14) + PosY - SHeight
  50.                     n = Int(n / 2)
  51.                     Select Case n
  52.                         Case 1:
  53.                             SetTextColor hDC, C(5)
  54.                         Case 2:
  55.                             SetTextColor hDC, C(4)
  56.                         Case 3:
  57.                             SetTextColor hDC, C(3)
  58.                         Case 4:
  59.                             SetTextColor hDC, C(2)
  60.                         Case 5:
  61.                             SetTextColor hDC, C(1)
  62.                         Case Else:
  63.                             SetTextColor hDC, C(0)
  64.                     End Select
  65.                 Else
  66.                     SetTextColor hDC, C(5)
  67.                 End If
  68.                 TextOut hDC, SWidth / 2, (i * 14) + PosY, Strings(i), Len(Strings(i))
  69.             Next i
  70. End Sub
  71.